import { http } from '@/utils/http'
// 添加购物车
export const postMemberCartAPI = (data: { skuId: string; count: number }) => {
  return http({
    method: 'POST',
    url: '/member/cart',
    data,
  })
}
// 获取购物车信息
export const getMemberCartAPI = () => {
  return http({
    method: 'GET',
    url: '/member/cart',
  })
}
// 删除/清空购物车信息
export const deleteMemberCartAPI = (data: { ids: string[] }) => {
  return http({
    method: 'DELETE',
    url: '/member/cart',
    data,
  })
}
// 修改购物车数量
export const putMemberCartAPI = (skuId: string, data: { selected?: boolean; count?: number }) => {
  return http({
    method: 'PUT',
    url: `/member/cart/${skuId}`,
    data,
  })
}
//  购物车全选/取消全选
export const putMemberCartSelectAPI = (data: { selected: boolean }) => {
  return http({
    method: 'PUT',
    url: `/member/cart/selected`,
    data,
  })
}
